﻿namespace ClassLibrary.BusinessLayer.Facade
{
    using ClassLibrary.BusinessLayer.BusinessObjects;
    using ClassLibrary.DataLayer.DataObjects;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Data.Common;

    [DataObject(true)]
    public class ProjectSupervisorFacade
    {
        private IProjectSupervisorDAO projectSupervisorDAO = DAOAccess.ProjectSupervisorDAO;

        [DataObjectMethod(DataObjectMethodType.Insert)]
        public bool AddProjectSupervisor(ProjectSupervisor2 clsProjectSupervisor)
        {
            return this.projectSupervisorDAO.InsertProjectSupervisor(clsProjectSupervisor);
        }

        [DataObjectMethod(DataObjectMethodType.Insert)]
        public int AddProjectSupervisorAndReturnIdentity(ProjectSupervisor2 clsProjectSupervisor)
        {
            return this.projectSupervisorDAO.InsertProjectSupervisorReturnIdentity(clsProjectSupervisor);
        }

        [DataObjectMethod(DataObjectMethodType.Insert)]
        public string AddProjectSupervisorAndReturnOutput(ProjectSupervisor2 clsProjectSupervisor)
        {
            return this.projectSupervisorDAO.InsertProjectSupervisorReturnOutput(clsProjectSupervisor);
        }

        [DataObjectMethod(DataObjectMethodType.Delete)]
        public bool DeleteProjectSupervisor(ProjectSupervisor2 clsProjectSupervisor)
        {
            return this.projectSupervisorDAO.DeleteProjectSupervisor(clsProjectSupervisor);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public IList<ProjectSupervisor2> GetProjectSupervisor(ProjectSupervisor2 clsProjectSupervisor)
        {
            return this.projectSupervisorDAO.GetProjectSupervisor(clsProjectSupervisor);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public IList<ProjectSupervisor2> GetProjectSupervisor(string ProjectCode)
        {
            ProjectSupervisor2 clsProjectSupervisor = new ProjectSupervisor2();
            clsProjectSupervisor.ProjectCode = ProjectCode;
            return this.projectSupervisorDAO.GetProjectSupervisor(clsProjectSupervisor);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public IList<ProjectSupervisor2> GetsProjectSupervisor()
        {
            return this.projectSupervisorDAO.GetsProjectSupervisor();
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public DataTable GetsProjectSupervisor(string SPName, DbParameter[] param)
        {
            return this.projectSupervisorDAO.GetsProjectSupervisor(SPName, param);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public IList<ProjectSupervisor2> ListProjectSupervisor(ProjectSupervisor2 clsProjectSupervisor)
        {
            return this.projectSupervisorDAO.ListProjectSupervisor(clsProjectSupervisor);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public IList<ProjectSupervisor2> ListProjectSupervisor(string ProjectCode)
        {
            ProjectSupervisor2 clsProjectSupervisor = new ProjectSupervisor2();
            clsProjectSupervisor.ProjectCode = ProjectCode;
            return this.projectSupervisorDAO.ListProjectSupervisor(clsProjectSupervisor);
        }

        [DataObjectMethod(DataObjectMethodType.Update)]
        public bool UpdateProjectSupervisor(ProjectSupervisor2 clsProjectSupervisor)
        {
            return this.projectSupervisorDAO.UpdateProjectSupervisor(clsProjectSupervisor);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public int UpdateProjectSupervisor(string SPName, DbParameter[] param)
        {
            return this.projectSupervisorDAO.UpdateProjectSupervisor(SPName, param);
        }
    }
}

